<?php

namespace app\admin\validate;

use think\Validate;

class AuthRule extends Validate
{    
    /**
     * 验证规则
     */
    protected $rule = [
        'type|节点类型'  => 'require|in:menu,file',
        'pid|上级节点'  => 'require|integer|max:10',   
        'name|节点地址'  => 'require|max:100',   
        'title|节点名称'  => 'require|max:50',   
        'icon|图标定义'  => 'max:50',
        'condition' => 'max:255',
        'remark' => 'max:255',
        'ismenu' => 'require|in:0,1',
        'weigh' => 'integer|max:10',
        'module' => 'max:50',
    ];

    /**
     * 提示消息
     */
    protected $message = [
        // 'username.require'  =>  '登录名不能为空',
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        // 'add'  => ['type','pid',],
        // 'edit' => ['pid','name', 'status'],
    ];
}
